﻿using STSdb4.Database;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UserCenter.Console.Sdk.Demo.Core
{
    public class TableInfo<T> : IDisposable
    {
        private IStorageEngine db;
        private ITable<Guid, T> table;

        public TableInfo(IStorageEngine db, ITable<Guid, T> table)
        {
            this.db = db;
            this.table = table;
        }

        public IStorageEngine Database { get { return db; } }

        public ITable<Guid, T> Table { get { return table; } }

        public void Dispose()
        {
            Database.Commit();
           // Database.Dispose();
        }

        //public ITable<Guid, M> GetTable<M>()
        //{
        //    var table = db.OpenXTable<Guid, M>(typeof(M).Name);
        //    return table;
        //}


    }
}
